import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpUsersCert {
  id!: number;
  certUrl!: unknown;
  type!: number;
  userId!: number;
  time!: string;
  title!: string;
  uniacid!: number;
  rId?: number;
  pId?: number;
  qId?: number;
}

export const ImsYzdKpUsersCertSchema = new EntitySchema({
  class: ImsYzdKpUsersCert,
  properties: {
    id: { primary: true, type: 'number' },
    certUrl: { type: 'unknown', columnType: 'longtext' },
    type: { type: 'number', index: 'type' },
    userId: { type: 'number', index: 'user_id' },
    time: { type: 'string', length: 255 },
    title: { type: 'string', length: 255 },
    uniacid: { type: 'number', index: 'uniacid' },
    rId: { type: 'number', nullable: true },
    pId: { type: 'number', nullable: true },
    qId: { type: 'number', nullable: true },
  },
});
